package org.redis.cluster.command;

import org.redis.cluster.processor.CommandProcessor;
import org.redis.cluster.redis.RedisCommand;
import org.redis.cluster.redis.transport.RedisReply;
import org.redis.cluster.redis.transport.reply.RedisBulkReply;
import org.redis.cluster.transport.session.Session;

public class EchoCommandProcessor implements CommandProcessor {
	
	private final static String COMMAND="ECHO";

	@Override
	public RedisReply process(RedisCommand command, Session session) {
		if(command.getParameterCount()!=2) {
			return null;
		}
		
		return new RedisBulkReply(command.getParameters()[1]);
	}

	@Override
	public String getSupportCommand() {
		return COMMAND;
	}

}